<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>取得客户端编码方式</title>
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-base.css" />
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-medium.css" />

 </head>
 <body class="docs"><div class="navbar navbar-fixed-top">
  <div class="navbar-inner clearfix">
    <ul class="nav" style="width: 100%">
      <li style="float: left;"><a href="function.pg-cancel-query.html">« pg_cancel_query</a></li>
      <li style="float: right;"><a href="function.pg-close.html">pg_close »</a></li>
    </ul>
  </div>
</div>
<div id="breadcrumbs" class="clearfix">
  <ul class="breadcrumbs-container">
    <li><a href="index.html">PHP Manual</a></li>
    <li><a href="ref.pgsql.html">PostgreSQL 函数</a></li>
    <li>取得客户端编码方式</li>
  </ul>
</div>
<div id="layout">
  <div id="layout-content"><div id="function.pg-client-encoding" class="refentry">
   <div class="refnamediv">
    <h1 class="refname">pg_client_encoding</h1>
    <p class="verinfo">(PHP 4 &gt;= 4.0.3, PHP 5, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">pg_client_encoding</span> &mdash; <span class="dc-title">
     取得客户端编码方式
    </span></p>

   </div>
   <div class="refsect1 unknown-unknown-unknown-descriptioq" id="refsect1-function.pg-client-encoding-unknown-unknown-unknown-descriptioq">
    <h3 class="title">说明</h3>      
     <div class="methodsynopsis dc-description">
      <span class="methodname"><strong>pg_client_encoding</strong></span>(<span class="methodparam"><span class="type">resource</span> <code class="parameter">$connection</code><span class="initializer"> = ?</span></span>): <span class="type">string</span></div>

    <p class="para rdfs-comment">
     <span class="function"><strong>pg_client_encoding()</strong></span> 以字符串形式返回客户端编码。所返回的字符串为以下之一：SQL_ASCII，EUC_JP，EUC_CN，EUC_KR，EUC_TW，UNICODE，MULE_INTERNAL，LATINX (X=1...9)，KOI8，WIN，ALT，SJIS，BIG5，WIN1250。
    </p>
    <blockquote class="note"><p><strong class="note">注意</strong>: 
     <p class="para">
      本函数需要 PHP-4.0.3 或以上版本以及 PostgreSQL-7.0 或以上版本。如果在编译 libpq 时没有加入多字节编码支持，则 <span class="function"><a href="function.pg-set-client-encoding.html" class="function">pg_set_client_encoding()</a></span> 总是返回 &quot;SQL_ASCII&quot;。所支持的编码方式取决于 PostgreSQL 的版本。详情参见 PostgreSQL 手册如何加入多字节支持以及所支持的编码方式。
     </p>
     <p class="para">
      本函数以前被称为 <span class="function"><strong>pg_clientencoding()</strong></span>。
     </p>
    </p></blockquote>
    <p class="para">
     参见 <span class="function"><a href="function.pg-set-client-encoding.html" class="function">pg_set_client_encoding()</a></span>。
    </p>
   </div>

  </div></div></div></body></html>